Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix weak comparison between '0' and false #99

Merged
merged 1 commit into from
Sep 14, 2022
Merged

Fix weak comparison between '0' and false #99

merged 1 commit into from
Sep 14, 2022

Conversation

mvorisek
Copy link
Contributor

@mvorisek mvorisek marked this pull request as ready for review May 21, 2022 20:54
@mvorisek mvorisek changed the title add test Fix weak comparison between 0 and false May 21, 2022
@mvorisek mvorisek changed the title Fix weak comparison between 0 and false Fix weak comparison between '0' and false May 21, 2022
@mvorisek mvorisek changed the title Fix weak comparison between '0' and false Fix weak comparison between '0' and false May 22, 2022
@mvorisek
Copy link
Contributor Author

mvorisek commented Jun 1, 2022

@sebastianbergmann can you please merge this fix into 3.0 - 5.0 to fix phpunit 8.5 and 9.5?

Github Actions CI should be probably backported to 3.0 branch too, but I run the tests and they are passing.

@@ -51,7 +51,7 @@ public function assertEquals($expected, $actual, $delta = 0.0, $canonicalize = f

// always compare as strings to avoid strange behaviour

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This behaviour exist since 9 years, changing it may be a BC break.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that is true, but 0 equals false, so '0' must too, it is also the php behaviour of weak comparison

@sebastianbergmann sebastianbergmann merged commit a6635b6 into sebastianbergmann:3.0 Sep 14, 2022
@sebastianbergmann
Copy link
Owner

Thank you.

Versions 3.0.4 and 4.0.7 have been tagged, sebastianbergmann/phpunit#4972 can be updated.

@mvorisek mvorisek deleted the fix_false_num_zero_str_cmp branch September 14, 2022 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants